/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.bar.carta.model.impl;

import com.bar.carta.model.Plato;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.CacheModel;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing Plato in entity cache.
 *
 * @author pgonzalm
 * @see Plato
 * @generated
 */
public class PlatoCacheModel implements CacheModel<Plato>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(13);

		sb.append("{platoId=");
		sb.append(platoId);
		sb.append(", tipoId=");
		sb.append(tipoId);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", activo=");
		sb.append(activo);
		sb.append(", imagen=");
		sb.append(imagen);
		sb.append(", precio=");
		sb.append(precio);
		sb.append("}");

		return sb.toString();
	}

	public Plato toEntityModel() {
		PlatoImpl platoImpl = new PlatoImpl();

		platoImpl.setPlatoId(platoId);
		platoImpl.setTipoId(tipoId);

		if (createDate == Long.MIN_VALUE) {
			platoImpl.setCreateDate(null);
		}
		else {
			platoImpl.setCreateDate(new Date(createDate));
		}

		platoImpl.setActivo(activo);
		platoImpl.setImagen(imagen);
		platoImpl.setPrecio(precio);

		platoImpl.resetOriginalValues();

		return platoImpl;
	}

	public long platoId;
	public long tipoId;
	public long createDate;
	public boolean activo;
	public long imagen;
	public float precio;
}